package com.neusoft.resturant.mapper;


import com.neusoft.resturant.entity.SysUser;
import org.apache.ibatis.annotations.*;

@Mapper
public interface SysUserMapper {

    @Select("select user_id, dept_id, user_name, nick_name, email, avatar, phonenumber, password, sex, status from sys_user where user_name = #{userName}")
    SysUser selectUserByUserName(String userName);


    @Insert("INSERT INTO sys_user(user_name, password, email, phonenumber, nick_name, avatar, sex, status) VALUES(#{userName}, #{password}, #{email}, #{phonenumber}, #{nickName}, #{avatar}, #{sex}, #{status})")
    int insertUser(SysUser sysUser);

    @Update("UPDATE sys_user SET user_id=#{id},user_name = #{userName}, password = #{password}, email = #{email}, phonenumber = #{phonenumber}, nick_name = #{nickName}, avatar = #{avatar}, sex = #{sex}, status = #{status} WHERE user_id = #{id}")
    int updateUser(SysUser sysUser);
}
